package cn.edu.just.firstjavaapp.l12;


import java.util.Date;

public class DateDemo {
    public static void main(String[] args) {
        java.util.Date now = new java.util.Date();
        System.out.println(now);
        Date birthday = new Date(100,10,1);//年从1900开始算。月份0表示1月，10表示11月
        System.out.println(birthday);
        System.out.println("year:"+(now.getYear()+1900));
        System.out.println("month:"+(now.getMonth()+1));
        System.out.println("hour:"+now.getHours());
    }
}
